<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
    <style>
        /** {*/
        /*padding: 0;*/
        /*margin: 0;*/
        /*list-style: none;*/
        /*}*/

        .canvas {
            border: 1px solid black;
        }
    </style>
</head>
<body>
<div class="content_body">
    <canvas class="canvas" width="700px" height="400px"></canvas>
</div>
<script>
    let canvas = document.getElementsByClassName("canvas")[0];
    let ctx = canvas.getContext('2d');
    let canvasHeight = ctx.canvas.height;
    let canvasWidth = ctx.canvas.width;
    let space = 20;
    let arrowSize = 10;
    let x0 = space;
    let y0 = canvasHeight - space;
    // 绘制x轴
    ctx.beginPath();
    ctx.moveTo(x0, y0);
    ctx.lineTo(canvasWidth - space, y0);
    // 箭头
    ctx.lineTo(canvasWidth - space - arrowSize, y0 + arrowSize / 2);
    ctx.lineTo(canvasWidth - space - arrowSize, y0 - arrowSize / 2);
    ctx.lineTo(canvasWidth - space, y0);
    ctx.fill();
    ctx.stroke();

    // 绘制y轴
    ctx.beginPath();
    ctx.moveTo(x0, y0);
    ctx.lineTo(space, space);
    // 箭头
    ctx.lineTo(space + arrowSize / 2, space + arrowSize);
    ctx.lineTo(space - arrowSize / 2, space + arrowSize);
    ctx.lineTo(space, space);
    ctx.fill();
    ctx.stroke();


</script>
</body>
</html>